package iut.acy.cut4u.dao;

public abstract class EntiteDAO {

    protected DataBaseManager db;

    public EntiteDAO() {
        db = DataBaseManager.getInstance();

    }

    public abstract int update(Object o) throws AlternativeKeyException;

    public abstract int delete(Object o, boolean enCascade);

    public abstract int insert(Object o);

    /**
     * @return the db
     */
    public DataBaseManager getDb() {
        return db;
    }
    
    public static String strToNull(String str)
    { 
    	if (str.equals(""))
    		return ",NULL";
    	else
    		return ",'"+str+"'";
    }

}
